<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        //编写一个JavaScript对象
        var user={
            name:"程子冉",
            id:1,
            age:20
        };
//        将js对象转换为json
       var json= JSON.stringify(user);
        //将json转为编写一个JavaScript对象
      var json1=JSON.parse(json)
        console.log(json);
        console.log(user);
        console.log(json1);
    </script>
</head>
<body>

</body>
</html>